package com.aizhixin.lab.project.course.repository;

import com.aizhixin.lab.project.course.entity.ProjectGroupTask;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Date;
import java.util.List;

public interface ProjectGroupTaskRepository extends JpaRepository<ProjectGroupTask,String> {
    Integer countByProjectIdAndStuIdAndTaskStatusInAndDeleteFlag(String projectId, Long stuId, List<String> taskStatus,Integer deleteFlag);
    Integer countByWorkOrderIdAndProjectClassId(String workOrderId,String projectClassId);
    Integer countByTaskIdAndAndProjectClassIdAndWorkOrderIdIsNull(String taskId,String projectClassId);
    Integer countByProjectIdAndStuIdAndDeleteFlag(String projectId, Long stuId,Integer deleteFlag);
    ProjectGroupTask findByProjectIdAndStuIdAndDeleteFlagAndTaskId(String projectId, Long stuId,Integer deleteFlag,String taskId);
    List<ProjectGroupTask> findByTaskStatusInAndDeleteFlag(List<String> status,Integer deleteFlag);
    List<ProjectGroupTask> findByProjectIdAndStuIdAndDeleteFlag(String projectId, Long stuId,Integer deleteFlag);
    List<ProjectGroupTask> findByProjectIdAndStuIdAndDeleteFlagAndTaskGradeNotNull(String projectId, Long stuId,Integer deleteFlag);
    Integer countByStuIdAndProjectIdAndDeleteFlagAndTaskStatus(Long stuId,String projectId,Integer deleteFlag,String status);
    List<ProjectGroupTask> findByProjectIdAndGroupIdAndDeleteFlag(String projectId,String groupId,Integer deleteFlag);
    List<ProjectGroupTask> findByProjectIdAndGroupIdAndDeleteFlagOrderByCreatedDateDesc(String projectId,String groupId,Integer deleteFlag);
    List<ProjectGroupTask> findByProjectIdAndGroupIdAndStuIdAndDeleteFlag(String projectId,String groupId,Long stuId,Integer deleteFlag);
    List<ProjectGroupTask> findByProjectIdAndGroupIdAndTaskStatusNotAndRealityEndDateBetweenAndDeleteFlag(String projectId, String groupId, String status, Date statrTime,Date endTime,Integer deleteFlag);
    List<ProjectGroupTask> findByProjectIdAndGroupIdAndTaskStatusNotAndDeleteFlag(String projectId, String groupId, String status,Integer deleteFlag);
    Integer countByProjectIdAndGroupIdAndTaskStatusAndDeleteFlagAndStuId(String projectId,String groupId,String taskStatus,Integer deleteFlag,Long sutId);
    List<ProjectGroupTask> findByTaskIdAndProjectClassIdAndDeleteFlagAndWorkOrderIdIsNull(String taskId,String projectClassId,Integer deleteFlag);
    List<ProjectGroupTask> findByWorkOrderIdAndProjectClassIdAndDeleteFlag(String workOrderId,String projectClassId,Integer deleteFlag);
}
